from pymongo import MongoClient


class MongoFactory:
    _instance = None

    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = object.__new__(cls, *args, *kwargs)
        return cls._instance

    def __init__(self):
        self.client = MongoClient('localhost', 27017)
        self.test_db = self.client['test']
        self.customer_collection = self.test_db['customer']
